<template>
	<view>
		<u-navbar :is-back="true" :is-fixed="true" title="我的证件"></u-navbar>
		<scroll-view scroll-y scroll-with-animation style="height: calc(100vh - 50px);" :show-scrollbar="false">
			<free-divider></free-divider>

			<view class="pl-2 pr-2 py-3">
				<view class="dfex border-bottom mt-2 pb-3" v-for="(item,index) in 2">
					<view class="font-14">营业执照</view>
					<img class="pl-5" style="width: 144px; height: 88px;" src="/static/logo.png" alt="" srcset="" />
					<view class="dfex text-8ED0F2 pl-2 mt-14 font-14" style="width: 100px;">
						<view>下载</view>
						<view>删除</view>
					</view>
				</view>

			</view>

			<ferrButton title="编辑信息" @click="click()"></ferrButton>
			<!-- 修改名字|修改微信号 弹框-->
			<free-confirm ref="confirm" :title="confirmTitle">
				<u-field v-model="confirmText" label="证件名称" placeholder="请输入原密码">
				</u-field>
				<view class="flex-y py-3 pl-2 pr-2">
					<view class="">
						证件上传
					</view>
					<u-upload :action="action" max-count="1" :file-list="fileList"></u-upload>
				</view>

			</free-confirm>
		</scroll-view>
	</view>
</template>

<script>
	import $H from '@/common/free-lib/request.js';
	import freeAvater from "@/components/free-ui/free-avater.vue";
	import freeDivider from "@/components/free-ui/free-divider.vue";
	import ferrButton from "@/components/free-ui/ferr-button.vue";
	import freeConfirm from "@/components/free-ui/free-confirm.vue";
	export default {
		components: {
			freeAvater,
			freeDivider,
			freeConfirm,
			ferrButton
		},
		data() {
			return {

				confirmType: "",
				confirmText: '',
				// 演示地址，请勿直接使用
				action: 'http://www.example.com/upload',
				fileList: [{
					url: 'http://pics.sc.chinaz.com/files/pic/pic9/201912/hpic1886.jpg',
				}, ]
			}
		},
		computed: {
			confirmTitle() {
				return this.confirmType == 'username' ? '添加新证件' : '添加新证件'
			},
		},
		methods: {
			click() {

				this.$refs.confirm.show((close) => {
					if (this.confirmText === '') {
						uni.showToast({
							title: "不能为空",
							icon: 'none'
						});
						return;
					}

					this.user[key] = this.confirmText;
					uni.showToast({
						title: "修改成功",
						icon: 'none'
					});
					close();
				});
			},
			getPapers(){
				uni.showLoading({
					title: '加载中'
				});
				$H.get('/basisInform/papersManage/upper/List').then(res => {
					
				})
			}

		}
	}
</script>

<style>
</style>